/*
 * @Description:
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-11-20 14:15:52
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-12-08 12:45:03
 */
import { request } from '@/utils/request';

/**
 * 查询所有票菜单
 * @param params
 * @returns
 */
export function selectAllPackage(params: API.PageParams) {
  return request<API.SeachResult<API.PackageItem[]>>(
    {
      url: '/package/selectAll',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 添加票菜单
 * @param data
 * @returns
 */
export function insertTicketPackage(data: API.PackageItem) {
  return request<API.BaseResult>(
    {
      url: '/package/insertTicketPackage',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * 根据ID 查询票菜单详情
 * @param params
 * @returns
 */
export function selectPackageByExample(data: API.PackageItem, params: API.PageParams) {
  return request<API.SeachResult<API.PackageItem[]>>(
    {
      url: '/package/selectByExample',
      method: 'post',
      data,
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 根据ID 查询票菜单详情
 * @param params
 * @returns
 */
export function selectPackageById(params: API.PackageItem) {
  return request<API.PackageItem>(
    {
      url: '/package/selectById',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 更新票带单
 * @param data
 * @returns
 */
export function updateTicketPackage(data: API.PackageItem) {
  return request<API.BaseResult>(
    {
      url: '/package/updateTicketPackage',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}

/**
 * 根据ID删除票菜单
 * @param data
 * @returns
 */
export function deleteTicketPackage(data: API.PackageItem) {
  return request<API.BaseResult>(
    {
      url: '/package/deleteTicketPackage',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}
